package com.qing.demo.netty.client;


import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.socket.DatagramPacket;

import java.nio.charset.Charset;

/**
 * @author caozhipeng
 * @date 2025/7/25
 */
public class MyClientHandler extends SimpleChannelInboundHandler<DatagramPacket> {


    @Override
    protected void messageReceived(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
        System.out.println("客户端收到服务端消息："+msg.content().toString(Charset.forName("utf-8")));
    }

}
